home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.2 KB | 110 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWResFil.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #if !defined(FWRESFIL_H) && !defined(__ODFRC__)
- #define FWRESFIL_H
-
- #ifndef FWSOMPTR_H
- #include "FWSOMPtr.h"
- #endif
-
- #ifndef FWEXCDEF_H
- #include "FWExcDef.h"
- #endif
-
- #ifndef FWCOUPTR_H
- #include "FWCouPtr.h"
- #endif
-
- #include "SLResFil.xh"
-
- //========================================================================================
- // CLASS FW_PResourceFile
- //
- // Inherited API for operator->()
- //
- // FW_OFileSpecification GetFileSpecification();
- // // Get the file specification for the resourcesFile.
- //
- // FW_Boolean HasResource(in FW_ResourceId resourceId,
- // in FW_ResourceType resourceType);
- // // Returns TRUE if the resource exists in the file, FALSE if it doesn't.
- //
- // FW_ResourceHandle GetResourceHandle(in FW_ResourceId resourceId,
- // in FW_ResourceType resourceType);
- // // Gets the resource handle. Resource data may still be purgeable or unloaded.
- // // Client assumes responsibility to call ReleaseResourceHandle when done.
- //
- // void ReleaseResourceHandle(in FW_ResourceHandle handle);
- // // Releases the resource handle. All memory is released.
- //
- //========================================================================================
-
- class FW_PResourceFile : public FW_TCountedSOMPtr<FW_OResourceFile>
- {
- public:
-
- FW_DECLARE_AUTO(FW_PResourceFile)
-
- FW_PResourceFile(Environment* ev, FW_OResourceFile *rep);
- // Attach to the given resources file rep.
-
- FW_PResourceFile(Environment* ev, FW_OFileSpecification* newFileSpec);
- // Open a resources file by name.
- // This instance assumes responsibility for closing the file.
-
- FW_PResourceFile(Environment* ev, FW_ResourceFileID resFileID);
- // Attach to an already opened resource file.
- // This instance does not assume responsibility for closing the file.
-
- virtual ~FW_PResourceFile();
-
- FW_PResourceFile(const FW_PResourceFile& other);
- // Copy constructor, attach to same file as other.
-
- void operator=(const FW_PResourceFile& other);
- // Assignment operator.
-
- protected:
- FW_PResourceFile();
- };
-
-
- //----------------------------------------------------------------------------------------
- // FW_PResourceFile::operator=
- //----------------------------------------------------------------------------------------
- inline void FW_PResourceFile::operator=(const FW_PResourceFile& other)
- {
- FW_TCountedSOMPtr<FW_OResourceFile>::operator=(other);
- }
-
-
-
- #if defined FW_BUILD_MAC
- //========================================================================================
- // CLASS FW_CMacResLoadFalse
- //========================================================================================
- // This utility class provides a mechanism to ::SetResLoad(false) and then be
- // assured that ::SetResLoad(true) is executed even in the presend of an FW_THROW
-
- class FW_CMacResLoadFalse
- {
- public:
- FW_DECLARE_AUTO(FW_CMacResLoadFalse)
-
- FW_CMacResLoadFalse();
- // Sets ResLoad false
-
- ~FW_CMacResLoadFalse();
- // Sets ResLoad true
- };
- #endif
-
- #endif
-